#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

char *const argv[] = {
	(char*const)"ls",
	(char*const)"-a",
	(char*const)"-l",
	NULL
};

char*const env[] = {
	"MYVAL1=1234567",
	"MYVAL2=6666666",
	NULL
};

int main()
{
	printf("我的程序要运行了！\n");
	if (fork() == 0)
	{
		sleep(1);
		putenv("MYVAL1=1234567");
		putenv("MYVAL2=6666666");
		extern char **environ;
		execvpe("./other", argv, environ);
		exit(1);
	}

	waitpid(-1, NULL, 0);
	printf("我的程序运行完毕！\n");
	return 0;
}

